package redis

import "time"

// 缓存短信
func RedisSetSmsCode(mobile, code, sale string) {
	key := "sms:" + mobile + sale
	RedisDB.Set(key, code, time.Minute*5) //5分钟
}

// 获取短信
func RedisGetSmsCode(mobile, sale string) string {
	key := "sms:" + mobile + sale

	return RedisDB.Get(key).Val() //获取短信
}

// 销毁短信
func RedisDelSmsCode(mobile, sale string) {
	key := "sms:" + mobile + sale
	RedisDB.Del(key) //销毁短信
}
